package com.oocl.homework.format.moel;

import java.util.Comparator;

public class IdComparator implements Comparator<Customer> {

	public int compare(Customer o1, Customer o2) {
		
		if (o1.getId()==null||o2.getId()==null) {
			if (o1.getId()==null||o2.getId()==null) {
				return 0;
			}
			if(o1.getId()==null){
				return -1;
			}
			if(o2.getId()==null){
				return 1;
			}
		}
		return o1.getId().compareTo(o2.getId());
	}

}
